let mongoose = require('mongoose');

// 创建集合规则
let scheme = {
  name: {
    type: String,
    require: true,
    minLength: 2,
    maxLength: 8
  },
  age: {
    type: Number,
    require: true,
    min: 0,
    max: 100
  },
  password: {
    type: Number,
    require: true,
  },
  hobby: [String],
  email: String
}
const userScheme = new mongoose.Schema(scheme);
const user = mongoose.model('User', userScheme);
// console.log('user集合：', user.create());
// export = {};
module.exports = user;